package com.huonan.component.tmp.filter;

import com.huonan.component.tmp.vo.ExtractRegularInfo;
import com.huonan.component.tmp.vo.UserLanguageTextVo;
import com.mininglamp.bia.emojiextractor.PlatformEnum;

/**
 * 小红书站点文本处理
 */
public class XhsUserTextFilter extends UserTextFilter {

    // 昵称  
    private final String NICKNAME_REGULA = "@([^@#\\s]{1,24})(?:\\s|$|(?=#))";
    // TODO 话题 需要优化
    private final String TOPIC_REGULA = "#[^\\s#\\pP]{1,30}(?:\\[.+?\\])?(?:(?<=#)|(?=$)|(?<=\\pP))";
    // 链接
    private final String LINK_REGULA = "\\b(?:https?://|www\\.)\\S+(?:\\.html|\\.htm|\\.shtml|\\.xml)?\\b";

    private  final String OTHER_REGULA = "(.{1,30})的笔记|(我在#.+?笔记\\[笔记\\]#)";
    @Override
    public UserLanguageTextVo filter(String text) {
        ExtractRegularInfo exTractReg = ExtractRegularInfo.builder()
                .topicReg(TOPIC_REGULA).build();

        UserLanguageTextVo userLanguageTextVo = this.doFilter(PlatformEnum.XIAOHONGSHU, text, exTractReg);
        formatTags(userLanguageTextVo);
        return userLanguageTextVo;
    }

    @Override
    void formatTags(UserLanguageTextVo userLanguageTextVo) {

    }
}
